package com.lineage.server.serverpackets;

import com.lineage.server.model.Instance.L1PcInstance;

public class S_CharReset extends ServerBasePacket {
  private byte[] _byte;
  
  public S_CharReset(L1PcInstance pc, int lv, int hp, int mp, int ac, int str, int intel, int wis, int dex, int con, int cha) {
    this._byte = null;
    writeC(64);
    writeC(2);
    writeC(lv);
    writeC(pc.getTempMaxLevel());
    writeH(hp);
    writeH(mp);
    writeH(ac);
    writeC(str);
    writeC(intel);
    writeC(wis);
    writeC(dex);
    writeC(con);
    writeC(cha);
  }
  
  public S_CharReset(int point) {
    this._byte = null;
    writeC(64);
    writeC(3);
    writeC(point);
  }
  
  public S_CharReset(L1PcInstance pc) {
    this._byte = null;
    writeC(64);
    writeC(1);
    if (pc.isCrown()) {
      writeH(14);
      writeH(2);
    } else if (pc.isKnight()) {
      writeH(16);
      writeH(1);
    } else if (pc.isElf()) {
      writeH(15);
      writeH(4);
    } else if (pc.isWizard()) {
      writeH(12);
      writeH(6);
    } else if (pc.isDarkelf()) {
      writeH(12);
      writeH(3);
    } else if (pc.isDragonKnight()) {
      writeH(15);
      writeH(4);
    } else if (pc.isIllusionist()) {
      writeH(15);
      writeH(4);
    } 
    writeC(10);
    writeC(pc.getTempMaxLevel());
  }
  
  public S_CharReset(int pcObjId, int emblemId) {
    this._byte = null;
    writeC(64);
    writeC(60);
    writeD(pcObjId);
    writeD(emblemId);
  }
  
  public byte[] getContent() {
    if (this._byte == null)
      this._byte = getBytes(); 
    return this._byte;
  }
  
  public String getType() {
    return getClass().getSimpleName();
  }
}
